package May._02.homework.work6;

import java.util.HashMap;

public class Main {
    public static void main(String[] args) {
        String str=new String("aababcabcdabcde");
        HashMap<Character, Integer> strMap = new HashMap<>();
//        Iterator<Map.Entry<Character, Integer>> iteratorStr = strMap.entrySet().iterator();
        for (int i = 0; i < str.length(); i++) {
            Integer strMapOrDefault = strMap.getOrDefault(str.charAt(i), 0);
            strMap.put(str.charAt(i),strMapOrDefault+1);
        }
        System.out.println("strMap = " + strMap);
    }
}
